Post

Replies

Boosts

Views

Activity

Reply to RealityKit VideoMaterial not respecting compositing instructions
Ok, so a couple nights of trial and error I have both ends of this implemented. I can get a video drawing to a material via DrawableQueue, and I can display different imageFiles to each eye in a shaderGraphMaterial. I can't figure out how to glue the two bits together though... I changed the image files in the shader into color inputs, and then at load time I try to: if var material = cube.model?.materials.first as? ShaderGraphMaterial{ do{ try material.setParameter(name: "left", value:.textureResource(drawableTextureManager.textureResource) ) // <-this throws a ShaderGraphMaterial.Error.incorrectTypeForParameterName //try material.setParameter(name: "left", value:.color(CGColor(red: 1.0, green: 0.5, blue: 0.0, alpha: 1.0)) ) // <-this works } catch { print("oops") } cube.model?.materials = [material] } So I guess my questions are: are color inputs the correct way to get textures into a ShaderGraphMaterial? who do I setParameter with a texture/TextureResource/DrawableQueue Thanks!
Topic: Graphics & Games SubTopic: RealityKit Tags:
Feb ’24
Reply to RealityKit VideoMaterial not respecting compositing instructions
Ok, so a couple nights of trial and error I have both ends of this implemented. I can get a video drawing to a material via DrawableQueue, and I can display different imageFiles to each eye in a shaderGraphMaterial. I can't figure out how to glue the two bits together though... I changed the image files in the shader into color inputs, and then at load time I try to: if var material = cube.model?.materials.first as? ShaderGraphMaterial{ do{ try material.setParameter(name: "left", value:.textureResource(drawableTextureManager.textureResource) ) // <-this throws a ShaderGraphMaterial.Error.incorrectTypeForParameterName //try material.setParameter(name: "left", value:.color(CGColor(red: 1.0, green: 0.5, blue: 0.0, alpha: 1.0)) ) // <-this works } catch { print("oops") } cube.model?.materials = [material] } So I guess my questions are: are color inputs the correct way to get textures into a ShaderGraphMaterial? who do I setParameter with a texture/TextureResource/DrawableQueue Thanks!
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Feb ’24
Reply to RealityKit VideoMaterial not respecting compositing instructions
Yes, there are options that do not involve writing back to disk, though admittedly they are complicated. For example, you could use a DrawableQueue instead of VideoMaterial, and update the drawable with your altered video frames during playback. Ok, I can look into that... is there anyway to preserve 3d stereoscopic content when doing this?
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Feb ’24